<template>


  <!-- 搜索 -->
  <view class="search">
    <view class="search-box">

      <uni-search-bar @confirm="search" clearButton="auto" cancelButton="none" :placeholder="placeholder"
        bgColor="#EEEEEE">
      </uni-search-bar>

    </view>
  </view>

</template>

<script>
  export default {
    name: "my-search",
    // 父子传值
    props: ['placeholder'],
    data() {
      return {

      };
    },
    methods: {
      search(res) {
        // 调用API页面跳转
        this.$emit("confirm", res)
        // uni.navigateTo({
        //   // 指定详情页面的 URL 地址，并传递 goods_id 参数
        //   url: '/pages/searchlist/searchlist?query=' + res.value
        // })
      }
    }
  }
</script>

<style lang="scss">
  .search {
    height: 126rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .search-box {
    width: 686rpx;
  }

  .search-box text {
    font-size: 28rpx;
    color: #333333;
    padding-left: 20rpx;
  }
</style>